<?php if (!defined('SERVER_ROOT')) {exit('No direct script access allowed');}
//header
$this->template->title = 'Quá trình lương cán bộ';
$this->template->display('dsp_header.php');
$v_MA_HOC_VI        = $arr_filter['cbx_MA_HOC_VI'];
?>
 <form name="frmMain" id="frmMain" action="" method="POST">
    <?php
    echo $this->hidden('controller',$this->get_controller_url());
    echo $this->hidden('hdn_item_id','0');
    echo $this->hidden('hdn_item_id_list','');
    echo $this->hidden('hdn_dsp_single_method','dsp_single_canbo');
    echo $this->hidden('hdn_dsp_all_method','dsp_all_canbo');
    echo $this->hidden('hdn_update_method','update_canbo');
    echo $this->hidden('hdn_delete_method','delete_canbo');
    echo $this->hidden('hdn_TYPE_filter', 'MA_DON_VI');
    $v_row = 0;
    $namhientai=date('Y');
    $thanghientai=date('m');
    $n=2012;
    $v_row = 0;
    $STT = 0;
    ?>
   <div id="div_filter">
   <label>Học vị</label>
        <select id="cbx_MA_HOC_VI"
                name="cbx_MA_HOC_VI"
                onchange="cbx_onchange(this)"
                >
                  <?php while ($arr = $arr_all_hocvi->FetchRow()): ?>
                  <?php
                   $MA=$arr['MA_HOC_VI'];
                   $TEN=$arr['TEN_HOC_VI'];
                  ?>
                   <?php if($v_MA_HOC_VI == $MA):?>
                     <option value="<?php echo $MA; ?>" selected="selected"><?php echo $TEN; ?></option>
                  <?php else:?>
                     <option value="<?php echo $MA; ?>" ><?php echo $TEN; ?></option>
                  <?php endif ?>
                <?php endwhile; ?>
        </select>
               <input class = 'button' type="button" name="btn_add_canbo" value="In danh sách" onclick="In_click()"/>
	</div>

    <table  width="100%" class="adminlist" cellspacing="0" border="1">
        <colgroup>
            <col width="3%" />
            <col width="20%" />
            <col width="10%" />
            <col width="10%" />
            <col width="20%" />
            <col width="12%" />
            <col width="25%" />
        </colgroup>
        <tr>
            <th>STT</th>
            <th>Tên cán bộ</th>
            <th>Giới tính</th>
            <th>Năm sinh</th>
            <th>Chức vụ</th>
            <th>Học vị</th>
            <th>Đơn vị</th>
        </tr>
         <?php while ($arr = $arr_all_canbo->FetchRow()): ?>
             <?php
             $id=1;
             $STT=$STT+1;
             $MA_CAN_BO=$arr['MA_CAN_BO'];
             $TEN_CAN_BO=$arr['TEN_CAN_BO'];
             $GIOI_TINH=$arr['GIOI_TINH'];
             $NAM_SINH=$arr['NAM_SINH'];
             $TEN_CHUC_VU=$arr['TEN_CHUC_VU'];
             $TEN_HOC_VI=$arr['TEN_HOC_VI'];
             $TEN_DON_VI=$arr['TEN_DON_VI'];
             $v_class = 'row' . ($v_row % 2);
             $v_row++;
            ?>
            <tr class="<?php echo $v_class;?>">
                <td style="text-align:center;vertical-align: middle"><?php echo $STT;?></td>
                <td ><?php echo $TEN_CAN_BO;?></td>
                <td style="text-align:center;vertical-align: middle"><?php echo $GIOI_TINH;?></td>
                <td style="text-align:center;vertical-align: middle"><?php echo $NAM_SINH;?></td>
                <td><?php echo $TEN_CHUC_VU;?></td>
                <td><?php echo $TEN_HOC_VI;?></td>
                <td><?php echo $TEN_DON_VI;?></td>
            </tr>
           <?php endwhile; ?>
        <?php echo $this->add_empty_rows($v_row, _CONST_DEFAULT_ROWS_PER_PAGE, 7);?>
    </table>
</form>
<script>
    function cbx_onchange(e){
       var f = document.frmMain;
       f.submit();
    }
    function In_click() {
          var f = document.frmMain;
          mahocvi= f.cbx_MA_HOC_VI.value;
          var url = '<?php echo $this->get_controller_url(); ?>dsp_incanbo/' + mahocvi+'/';
          showPopWin(url, 850, 500, null);
   }
</script>
<?php $this->template->display('dsp_footer.php');